home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 003 / motorola / Sources / c / output < prev    next >
Text File  |  1993-07-18  |  1KB  |  47 lines

  1. #include <stdio.h>
  2.  
  3. #include "mselect.h"    /*external selection of microprocessor symbol table*/
  4. #include "proto.h"
  5. #include "as.h"
  6. #include "structs.h"
  7. #include "extvars.h"
  8.  
  9.  
  10.  
  11. /*
  12.  * stable --- prints the symbol table in alphabetical order
  13.  */
  14. void 
  15. stable(struct nlist * ptr)
  16. {
  17.         if (ptr != NULL) {
  18.                 stable(ptr->Lnext);
  19.                 fprintf(Mapfil, "%-10s %04x\n", ptr->name, ptr->def);
  20.                 stable(ptr->Rnext);
  21.         }
  22. }
  23. /*
  24.  * cross  --  prints the cross reference table
  25.  */
  26. void 
  27. cross(struct nlist * point)
  28. {
  29.         struct link    *tp;
  30.         int             i = 1;
  31.         if (point != NULL) {
  32.                 cross(point->Lnext);
  33.                 fprintf(Xfil, "%-10s %04x *", point->name, point->def);
  34.                 tp = point->L_list;
  35.                 while (tp != NULL) {
  36.                         if (i++ > 10) {
  37.                                 i = 1;
  38.                                 fprintf(Xfil, "\n                      ");
  39.                         }
  40.                         fprintf(Xfil, "%04d ", tp->L_num);
  41.                         tp = tp->next;
  42.                 }
  43.                 fprintf(Xfil, "\n");
  44.                 cross(point->Rnext);
  45.         }
  46. }
  47.